
//
//  UIButton+Extension.swift
//  Swift微博
//
//  Created by 白鹭 on 2017/3/4.
//  Copyright © 2017年 com.bailun91. All rights reserved.
//

import UIKit

extension UIButton{
    
    convenience init(imageName:String, BgImageName:String){
        
        self.init()
        
        setBackgroundImage(UIImage(named: BgImageName), for: UIControlState())
        setBackgroundImage(UIImage(named: BgImageName + "_Highlighted"), for: .highlighted)
        
        setImage(UIImage(named: imageName), for: UIControlState())
        setImage(UIImage(named:imageName + "_Highlighted"), for: .highlighted)
        sizeToFit()
        
    }
}

